package com.study.studyInstance;

public class TestInnerClass {
    public static void main(String[] args) {
        //创建非静态内部类对象的方式1
        Cat c = new Cat();
        Cat.Fish f = c.new Fish();
        System.out.println(f.getCatName());
        //创建非静态内部类对象的方式2
        Cat.Fish f1 = new Cat().new Fish();
        System.out.println(f1.getCatName());
    }
}
class Cat{
    private String name = "haki";
    //非静态内部类
    class Fish{
        //String name;
        public String getCatName(){
            return name;
        }
    }
}